<template>
  <div class="the-history-carousel" @mouseenter="isHover = true" @mouseleave="isHover = false">
    <div class="position-relative">
      <Swiper
        ref="historySlide"
        class="swiper history-swiper"
        :modules="swiperModules"
        :slides-per-view="1"
        :space-between="0"
        :speed="2000"
        :parallax="true"
        :direction="'horizontal'"
        :loop="false"
        :allow-touch-move="true"
        :pagination="{ el: '.swiper-pagination', clickable: true }"
        :navigation="{ nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }"
        @swiper="onSwiperReady"
        @slideChange="onSwiperSlideChange"
      >
        <template #container-start>
          <div
            class="parallax-bg"
            :data-swiper-parallax="fixBgPosition"
            :style="{
              transform: `translate3d(${fixBgPosition === '-380%' ? 0 : fixBgPosition}, 0, 0)`,
              'transition-duration': '0ms'
            }"
          ></div>
        </template>
        <SwiperSlide
          class="slide-box"
          v-for="items in list"
          :key="items.id"
        >
          <div 
            class="inside-wrap leftSide"
            v-for="(item, index) in items.timeSection"
            :key="item.id"
          >
            <div
              :style="{zIndex: index ? 1 : 50}"
              class="period"
              :data-swiper-parallax="index ? -300 : 0"
              :data-swiper-parallax-opacity="index ? 0.2 : 0.5"
            >
              <p>{{ item.year }}</p>
              <div class="period__iconPlus" @click="handleClick(item)">
                <img
                  :ref="item.year + index ? 'right' : 'left'"
                  src="" 
                  alt="了解更多"
                />
              </div>
              <div class="period__effect">
                <div
                  :id="'period__effect__circle' + index"
                  class="period__effect__circle"
                ></div>
              </div>
            </div>
            <div
              class="image"
              :data-swiper-parallax="index ? 600 : -400"
              :data-swiper-parallax-opacity="index ? 0 : 0.2"
            >
              <img :src="item.imgSrc" :alt="item.alt" />
            </div>
          </div>
          <div class="hisPopup">
            <transition name="fade">
              <LightHistoryPopup
                v-model:show="historyPopup"
                :historyPopupData="historyPopupData"
              />
            </transition>
          </div>
        </SwiperSlide>
      </Swiper>
      <div class="swiper-bottom">
        <div class="swiper-bottom__text">
          <p class="tx-subtitle text-uppercase text-center">
            {{ modelValue?.subtitle }}
          </p>
          <div class="position-relative w-100 celebrateTitle">
            <div
              class="
                swiper-button-prev
                swiper-button-black
                swiper-position-prev
              "
            ></div>
              <h1 class="text-uppercase text-center">
                {{ modelValue?.title }}
              </h1>
              <div
                class="
                  swiper-button-next
                  swiper-button-black
                  swiper-position-next
                "
              ></div>
          </div>
          <div class="year-pagination" ref="yearPagination">
            <div
              ref="yearBlock"
              v-for="(year, index) in list"
              class="year-pagination__box"
              :key="year.timeSection[0].year + index"
            >
              <h5
                @click="updatePage(index)"
                :class="{
                  pageActive: currentIndex === index,
                }"
              >
                {{ year.timeSection[0].year }}
              </h5>
              <div
                class="year-pagination__box__line"
                v-if="index + 1 !== list.length"
              ></div>
            </div>
          </div>
          <a v-if="modelValue?.btnType === 'btn'" :href="modelValue?.btnUrl || '#' " target="_blank" class="btn-primary mx-auto mt-2 btn-primary--white size-normal">
            <div class="btn-primary__text">{{ modelValue?.btnText }}</div>
            <span class="btn-primary__icon"></span>
          </a>
          <div v-else class="circle-link mx-auto mt-2 circle-link--light">
            <a :href="modelValue?.btnUrl || '#' " class="nuxt-link-active">
              <div data-v-d020e8b6="">{{ modelValue?.btnText }}</div> 
              <span class="circle-link__icon circle-link__icon--light"></span>
            </a>
          </div>
        </div>
      </div>
    </div>

    <Operate v-if="!isPreview" v-model:show="isHover" @handle-edit="showSetting = true" @handle-delete="handleDelete" @handle-copy="handleCopy" @handle-paste="handlePaste"></Operate>
  </div>

  <Setting v-if="!isPreview" v-model:show="showSetting" :data="modelValue"></Setting>
</template>

<script setup lang="ts">
import { ref, computed, watch } from 'vue'
import { Swiper, SwiperSlide } from 'swiper/vue'
import { Navigation, Pagination, Parallax } from 'swiper/modules'
// 导入 Swiper 样式
import 'swiper/css'
import 'swiper/css/navigation'
import 'swiper/css/pagination'
import Setting from './setting.vue'
import Operate from '@/common/Operate/index.vue'
import { randomString } from '@/utils/common'
import LightHistoryPopup from '@/common/LightHistoryPopup/index.vue'

// 定义组件名称
defineOptions({
  name: 'TheHistoryCarousel'
})

const props = defineProps({
  modelValue: {
    type: Object,
    default: () => {}
  },

  // 是否预览
  isPreview: {
    type: Boolean,
    default: true
  }
})

const emit = defineEmits(['update:modelValue', 'handleDelete', 'handleCopy', 'handlePaste'])

const handleInit = () => {
  if (props.modelValue && props.modelValue.data) return // 有数据不用初始化
  const data = {
    id: props.modelValue?.id || randomString(),
    type: 'TheHistoryCarousel',
    title: '标题',
    subtitle: '副标题',
    btnType: 'link',
    btnText: '按钮',
    btnUrl: 'http://baidu.com',
    isExternal: true,
    data: [
      {
        id: randomString(),
        timeSection: [
          {
            id: randomString(),
            title: '标题1',
            subtitle: '内容',
            year: '1990',
            imgSrc: 'https://osswebsite-test.cedim.cn/media-library/ywies-bj/images/home/ywies-tx.jpg',
            alt: '',
            linkUrl: 'http://baidu.com',
            isExternal: true,
          },
          {
            id: randomString(),
            title: '标题2',
            subtitle: '内容',
            year: '2000',
            imgSrc: 'https://osswebsite-test.cedim.cn/media-library/ywies-bj/images/home/ywies-tx.jpg',
            alt: '',
            linkUrl: 'http://baidu.com',
            isExternal: true,
          }
        ]
      },
      {
        id: randomString(),
        timeSection: [
          {
            id: randomString(),
            title: '标题3',
            subtitle: '内容',
            year: '2005',
            imgSrc: 'https://osswebsite-test.cedim.cn/media-library/ywies-bj/images/home/ywies-tx.jpg',
            alt: '',
            linkUrl: 'http://baidu.com',
            isExternal: true,
          },
        ]
      },
    ]
  }
  emit('update:modelValue', data)
} 

const isHover = ref<boolean>(false);
const showSetting = ref<boolean>(false);

const handleDelete = () => {
  emit('handleDelete', props.modelValue.id)
}

const handleCopy = () => {
  emit('handleCopy', props.modelValue)
}

const handlePaste = (type: string) => {
  emit('handlePaste', type)
}

handleInit()

// 响应式数据
const historyPopup = ref(false)
const currentIndex = ref(0)
const isSwiperReady = ref(false)
const BgPosition = ref('-23%')

// 模板引用
const historySlide = ref<any>(null)
const yearPagination = ref<HTMLElement | null>(null)
const yearBlock = ref<HTMLElement[]>([])

// Swiper 配置
const swiperModules = [Navigation, Pagination, Parallax]

// 监听器
watch(currentIndex, (newValue: number, oldValue: number) => {
  if (yearBlock.value && yearBlock.value[0] && yearPagination.value) {
    const yearWidth = yearBlock.value[0].clientWidth
    if (oldValue < newValue && newValue > 3) {
      yearPagination.value.scrollLeft += yearWidth
      return
    }
    if (oldValue > newValue && newValue < list.value.length - 4) {
      yearPagination.value.scrollLeft -= yearWidth
      return
    }
  }
})

const historyPopupData = ref({
  title: '',
  subtitle: '',
  linkUrl: '',
  isExternal: true
})
const handleClick = (item: any) => {
  historyPopup.value = true
  historyPopupData.value = {
    title: item.title,
    subtitle: item.subtitle,
    linkUrl: item.linkUrl,
    isExternal: item.isExternal,
  }
}

// 计算属性
const swiper = ref<any>(null)

const list = computed(() => {
  if (!props.modelValue?.data) return []

  if (typeof window !== 'undefined' && window.innerWidth < 576) {
    let dataList: any[] = []
    props.modelValue.data.forEach((item: any) => {
      item.timeSection.forEach((time: any) => {
        dataList.push({
          id: randomString(),
          timeSection: [time]
        })
      })
    })
    return dataList
  } else {
    // 返回每个幻灯片的第一个年份用于导航
    return props.modelValue.data
  }
})

const fixBgPosition = computed(() => {
  if (typeof window !== 'undefined' && window.innerWidth < 576) {
    const y = (2280 / list.value.length) / 2
    BgPosition.value = `-${y}%`
    return BgPosition.value
  } else {
    BgPosition.value = '-23%'
    return BgPosition.value
  }
})

const onSwiperReady = (swiperInstance: any) => {
  swiper.value = swiperInstance
  isSwiperReady.value = true
}

const onSwiperSlideChange = () => {
  if (swiper.value) {
    currentIndex.value = swiper.value.activeIndex
    historyPopup.value = false
  }
}

const updatePage = (idx: number) => {
  currentIndex.value = idx
  if (swiper.value) {
    swiper.value.slideTo(idx)
  }
}
</script>

<style lang="scss" scoped>
.the-history-carousel {
  position: relative;
  overflow: hidden;
}
.position-relative {
  position: relative!important
}
.tx-subtitle {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .1em
}

@media(max-width: 1023.98px) {
  .tx-subtitle {
      font-size:14px;
      line-height: 1.714
  }
}

@media(max-width: 767.98px) {
  .tx-subtitle {
      line-height:1.428
  }
}
.text-uppercase {
  text-transform: uppercase!important
}
.text-center {
  text-align: center!important
}
.w-100 {
  width: 100%!important
}

/* Minimal utilities migrated for TheHistoryCarousel */
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: 8px; }
.circle-link {
  display: flex;
  --link-color: var(--link-blue-color)
}
.circle-link a,.circle-link button {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.285;
  letter-spacing: .04em;
  border: none;
  background: none;
  color: var(--link-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0
}

@media(max-width: 1023.98px) {
  .circle-link a,.circle-link button {
      line-height:1.428
  }
}

@media(max-width: 767.98px) {
  .circle-link a,.circle-link button {
      line-height:1.285
  }
}

.circle-link a:hover .circle-link__icon:before,.circle-link button:hover .circle-link__icon:before {
  transform: translate(-50%,-50%)
}

.circle-link a:hover .circle-link__icon:after,.circle-link button:hover .circle-link__icon:after {
  transform: translate(150%,-50%)
}

.circle-link a:active .circle-link__icon:before,.circle-link button:active .circle-link__icon:before {
  transform: translate(-260%,-50%)
}

.circle-link a:active .circle-link__icon:after,.circle-link button:active .circle-link__icon:after {
  transform: translate(-50%,-50%)
}

.circle-link__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--link-color);
  position: relative;
  margin-left: 7px;
  flex-shrink: 0
}

@media(max-width: 767.98px) {
  .circle-link__icon {
      width:12px;
      height: 12px;
      margin-left: 4px
  }
}

.circle-link__icon:after,.circle-link__icon:before {
  content: "";
  width: 6px;
  height: 9px;
  position: absolute;
  top: 50%;
  left: 55%;
  background-image: url();
  background-position: 50%;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: hsla(0,0%,100%,0);
  transition: transform .3s ease-in-out
}

@media(max-width: 767.98px) {
  .circle-link__icon:after,.circle-link__icon:before {
      width:4.7px;
      height: 6px;
      background-image: url();
      background-position: 50%;
      background-size: cover;
      background-repeat: no-repeat;
      background-color: hsla(0,0%,100%,0)
  }
}

.circle-link__icon:before {
  transform: translate(-260%,-50%)
}

.circle-link__icon:after {
  transform: translate(-50%,-50%)
}


// Swiper 基础样式
:deep(.swiper-wrapper) {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  transition-property: transform;
  box-sizing: content-box;
}

:deep(.swiper-slide) {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  position: relative;
  transition-property: transform;
}

// Swiper 导航按钮样式
:deep(.swiper-button-next),
:deep(.swiper-button-prev) {
  position: absolute;
  top: 50%;
  width: 27px;
  height: 44px;
  margin-top: -22px;
  z-index: 10;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--swiper-navigation-color, var(--swiper-theme-color));

  &.swiper-button-disabled {
    opacity: 0.35;
    cursor: auto;
    pointer-events: none;
  }

  &:after {
    font-size: var(--swiper-navigation-size, 44px);
    text-transform: none !important;
    letter-spacing: 0;
    font-variant: initial;
    line-height: 1;
  }
}

:deep(.swiper-button-prev) {
  left: 10px;
  right: auto;

  &:after {
    content: 'prev';
  }
}

:deep(.swiper-button-next) {
  right: 10px;
  left: auto;

  &:after {
    content: 'next';
  }
}

// Swiper 分页器样式
:deep(.swiper-pagination) {
  position: absolute;
  text-align: center;
  transition: 300ms opacity;
  transform: translate3d(0, 0, 0);
  z-index: 10;
}

:deep(.swiper-pagination-bullet) {
  width: var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));
  height: var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));
  display: inline-block;
  border-radius: 50%;
  background: var(--swiper-pagination-bullet-inactive-color, #000);
  opacity: var(--swiper-pagination-bullet-inactive-opacity, 0.2);
  margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 4px);
  cursor: pointer;
}

:deep(.swiper-pagination-bullet-active) {
  opacity: var(--swiper-pagination-bullet-opacity, 1);
  background: var(--swiper-pagination-color, var(--swiper-theme-color));
}

:deep(.swiper-container) {
  overflow: unset;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s, transform 0.3s 0.2s;
}

.fade-enter,
.fade-leave-active {
  opacity: 0;
  transform: scale(0);
}

.tipFade-enter-active,
.tipFade-leave-active {
  transition: opacity 0.3s;
}

.tipFade-enter,
.tipFade-leave-active {
  opacity: 0;
}

.animation-icon-effect {
  animation-play-state: running !important;
  animation-direction: normal;
  animation-iteration-count: 1;
  animation-fill-mode: backwards;
  animation-name: iconEffectScale;
  animation-duration: 0.7s;
}

@keyframes iconEffectScale {
  0% {
    width: 0;
    height: 0;
    opacity: 0;
  }

  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    width: 100px;
    height: 100px;
  }
}

.swiper {
  width: 100%;
  height: 100%;
  background: #456ce5;
  position: relative;
}

// 移除自定义的 history-swiper 样式，使用原始样式

// 移除重复的 .swiper-slide 样式，已在上面定义

.parallax-bg {
  position: absolute;
  left: 0;
  top: 0;
  width: 130%;
  height: 102%;
  -webkit-background-size: cover;
  background-size: cover;
  background-position: center;
  background-image: url('https://ywies-tx.cedim.cn/_nuxt/img/home-history-banner.dac7153.png');

  @media (max-width: 576px) {
    width: 2230px;
  }
}
.swiper-slide {
  font-size: 18px;
  color: #fff;
  
  .period {
    width: fit-content;
    z-index: 100;
    position: relative;
    display: inline-block;
    left: calc(50% - 132px / 2);

    p {
      display: inline-block;
      font-size: 50px;
      font-weight: 900;
      line-height: 59.4px;
      letter-spacing: 0.1em;
      z-index: 10;
      position: relative;
    }

    &__iconPlus {
      position: absolute;
      top: -4px;
      right: -40px;
      cursor: pointer;
      z-index: 10;
      width: 60px;
      height: 60px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    &__effect {
      position: absolute;
      top: 18px;
      left: 143px;
      width: 20px;
      height: 20px;

      &__circle {
        border-radius: 50%;
        position: absolute;
        border: 4px solid white;
        width: 0;
        height: 0;
        transform: translate(-50%, -50%);
        top: 50%;
        left: 50%;
        opacity: 0;
        animation-play-state: paused;
      }
    }
  }
}

.swipe-tip {
  position: absolute;
  margin-top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border-radius: 4px;
  padding: 4px 8px;
  box-shadow: 0px 8px 32px rgba(130, 130, 140, 0.24);
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 280px;
  cursor: pointer;
  display: none;
  z-index: 4;

  @media (max-width: 576px) {
    display: flex;
  }

  p {
    color: #64788f; // 替换 #64788F
  }

  .iocn-tip {
    animation-name: moveRotate;
    animation-duration: 1.8s;
    animation-iteration-count: infinite;
    animation-fill-mode: forwards;
  }

  .close-btn {
    padding: 0;
    border: none;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    color: #666;
    cursor: pointer;
  }
}

@keyframes moveRotate {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(20deg);
  }

  75% {
    transform: rotate(-20deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.slide-box {
  height: 390px;
  max-height: 390px;
  display: flex;
  justify-content: center;
  // align-items: flex-end
  min-height: 360px;

  @media (max-width: 1230px) {
    padding-top: 60px;
    height: auto;
  }

  @media (max-width: 1200px) {
    justify-content: space-around !important;
  }

  .hisPopup {
    position: absolute;
    width: 100%;
    left: 0;
    top: 50%;
    display: flex;
    justify-content: center;
    transform: translate(0, -50%);
  }

  .inside-wrap {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transform: translateY(3px);
    width: 40%;

    @media (max-width: 1230px) {
      // width: 35%
    }

    @media (max-width: 768px) {
      min-width: 300px;
    }

    @media (max-width: 630px) {
      min-width: 272px;
    }

    @media (max-width: 576px) {
      width: 90%;
    }

    @media (max-width: 375px) {
      width: 100%;
    }
  }

  .image {
    height: 64%;

    @media (max-width: 1230px) {
      position: relative;
    }

    @media (max-width: 860px) {
      height: 56%;
    }

    @media (max-width: 640px) {
      height: 52%;
    }

    @media (max-width: 576px) {
      display: flex;
      justify-content: center;
    }

    img {
      height: 100%;
      margin: auto;
      display: block;
      width: 100%;
      object-fit: contain;
      max-width: 450px;

      @media (max-width: 576px) {
        padding: 0 15px;
      }
    }
  }
}

.closeRightSide {
  @media (max-width: 576px) {
    display: none !important;
  }
}

.swiper-bottom {
  position: relative;
  z-index: 1;
  height: 100%;
  background-color: #001e60; // 替换 $blue-darkest
  padding: 27px 0;

  &__text {
    color: white !important;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
  }
}

.pageActive {
  opacity: 1 !important;

  &::before {
    opacity: 1 !important;
  }
}

.year-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-bottom: 15px;
  padding-top: 20px;

  @media (max-width: 576px) {
    overflow: auto;
    scroll-behavior: smooth;
    width: 290px;
    justify-content: flex-start;
    padding-bottom: 24px;
  }

  &__box {
    display: flex;
    justify-content: center;
    align-items: center;

    h5 {
      transition: all 0.3s;
      opacity: 0.5;
      position: relative;
      transition: opacity 0.3s;
      cursor: pointer;

      &::before {
        position: absolute;
        top: calc(100% + 6px);
        left: calc(50% - 5px);
        content: '';
        width: 6px;
        height: 6px;
        background-color: #fff;
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.1s;
      }
    }

    &__line {
      width: 18px;
      height: 1px;
      background-color: #fff;
      opacity: 0.5;
      margin-left: 8px;
      margin-right: 8px;
    }
  }
}

.celebrateTitle {
  display: flex;
  align-items: center;
  justify-content: space-evenly;

  @media (max-width: 375px) {
    justify-content: space-between;
  }
}

.swiper-position-prev {
  position: relative;
  top: 0;
  margin-top: 0;
  transform: rotate(180deg);

  &::after {
    content: url();
    transform: translateY(-50%);
    top: calc(50% - 6px);
    position: absolute;
  }
}

.swiper-position-next {
  position: relative;
  top: 0;
  margin-top: 0;

  &::after {
    content: url();
    transform: translateY(-50%);
    top: calc(50% - 5px);
    position: absolute;
  }
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0032a0;
  background-color: var(--text-color--primary, #0032a0);
  padding: 11px 15px;
  min-width: 160px;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(130,130,140,.12);
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

@media (max-width: 1023.98px) {
  .btn-primary {
    padding: 11px 15px;
    min-width: 100px;
  }
}

@media (max-width: 767.98px) {
  .btn-primary {
    padding: 8px 12px;
    min-width: 80px;
  }
}

.btn-primary:hover .btn-primary__icon:before {
  transform: translate(-50%, -50%);
}

.btn-primary:hover .btn-primary__icon:after {
  transform: translate(150%, -50%);
}

.btn-primary:hover .btn-primary__icon:after,
.btn-primary:hover .btn-primary__icon:before {
  background-image: url();
  background-position: 50%;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: hsla(0,0%,100%,0);
}

@media (max-width: 767.98px) {
  .btn-primary:hover .btn-primary__icon:after,
  .btn-primary:hover .btn-primary__icon:before {
    background-image: url();
    background-position: 50%;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: hsla(0,0%,100%,0);
  }
}

.btn-primary:active:before {
  -webkit-clip-path: circle(100% at -80% 90%);
  clip-path: circle(100% at -80% 90%);
}

.btn-primary:active .btn-primary__icon:before {
  transform: translate(-260%, -50%);
}

.btn-primary:active .btn-primary__icon:after {
  transform: translate(-50%, -50%);
}

.btn-primary:active .btn-primary__icon:after,
.btn-primary:active .btn-primary__icon:before {
  background-image: url();
  background-position: 50%;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: hsla(0,0%,100%,0);
}

@media (max-width: 767.98px) {
  .btn-primary:active .btn-primary__icon:after,
  .btn-primary:active .btn-primary__icon:before {
    background-image: url();
    background-position: 50%;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: hsla(0,0%,100%,0);
  }
}

.btn-primary__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #fff;
  position: relative;
  margin-left: 7px;
  transition: background-color .3s ease-in-out;
  flex-shrink: 0;
}

@media (max-width: 767.98px) {
  .btn-primary__icon {
    width: 12px;
    height: 12px;
    margin-left: 6px;
  }
}

.btn-primary__icon:after,
.btn-primary__icon:before {
  content: "";
  width: 6px;
  height: 9px;
  position: absolute;
  top: 50%;
  left: 55%;
  background-image: url();
  background-position: 50%;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: hsla(0,0%,100%,0);
  transition: transform .3s ease-in-out;
}

@media (max-width: 767.98px) {
  .btn-primary__icon:after,
  .btn-primary__icon:before {
    width: 4.2px;
    height: 6px;
    background-image: url();
    background-position: 50%;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: hsla(0,0%,100%,0);
  }
}

.btn-primary__icon:before {
  transform: translate(-260%, -50%);
}

.btn-primary__icon:after {
  transform: translate(-50%, -50%);
}

.btn-primary--white {
  background-color: #fff;
  box-shadow: none
}

.btn-primary--white:before {
  background: #c1cede
}

.btn-primary--white .btn-primary__text {
  color: #0032a0;
  color: var(--text-color--primary,#0032a0);
  transition: color .3s ease-in-out
}

.btn-primary--white .btn-primary__icon {
  background-color: #0032a0;
  background-color: var(--text-color--primary,#0032a0)
}

.btn-primary--white .btn-primary__icon:after,.btn-primary--white .btn-primary__icon:before {
  background-image: url();
  background-position: 50%;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: hsla(0,0%,100%,0)
}

@media(max-width: 767.98px) {
  .btn-primary--white .btn-primary__icon:after,.btn-primary--white .btn-primary__icon:before {
      background-image:url();
      background-position: 50%;
      background-size: cover;
      background-repeat: no-repeat;
      background-color: hsla(0,0%,100%,0)
  }
}

.btn-primary--white:active .btn-primary__icon:after,.btn-primary--white:active .btn-primary__icon:before,.btn-primary--white:hover .btn-primary__icon:after,.btn-primary--white:hover .btn-primary__icon:before {
  background-image: url();
  background-position: 50%;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: hsla(0,0%,100%,0)
}

@media(max-width: 767.98px) {
  .btn-primary--white:active .btn-primary__icon:after,.btn-primary--white:active .btn-primary__icon:before,.btn-primary--white:hover .btn-primary__icon:after,.btn-primary--white:hover .btn-primary__icon:before {
      background-image:url();
      background-position: 50%;
      background-size: cover;
      background-repeat: no-repeat;
      background-color: hsla(0,0%,100%,0)
  }
}

.circle-link {
  display: flex;
  --link-color: var(--link-blue-color)
}

.circle-link--light {
  --link-color: var(--link-light-color)
}

.circle-link a,.circle-link button {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.285;
  letter-spacing: .04em;
  border: none;
  background: none;
  color: var(--link-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0
}

@media(max-width: 1023.98px) {
  .circle-link a,.circle-link button {
      line-height:1.428
  }
}

@media(max-width: 767.98px) {
  .circle-link a,.circle-link button {
      line-height:1.285
  }
}

.circle-link a:hover .circle-link__icon:before,.circle-link button:hover .circle-link__icon:before {
  transform: translate(-50%,-50%)
}

.circle-link a:hover .circle-link__icon:after,.circle-link button:hover .circle-link__icon:after {
  transform: translate(150%,-50%)
}

.circle-link a:active .circle-link__icon:before,.circle-link button:active .circle-link__icon:before {
  transform: translate(-260%,-50%)
}

.circle-link a:active .circle-link__icon:after,.circle-link button:active .circle-link__icon:after {
  transform: translate(-50%,-50%)
}

.circle-link__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--link-color);
  position: relative;
  margin-left: 7px;
  flex-shrink: 0
}

@media(max-width: 767.98px) {
  .circle-link__icon {
      width:12px;
      height: 12px;
      margin-left: 4px
  }
}

.circle-link__icon:after,.circle-link__icon:before {
  content: "";
  width: 6px;
  height: 9px;
  position: absolute;
  top: 50%;
  left: 55%;
  background-image: url();
  background-position: 50%;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: hsla(0,0%,100%,0);
  transition: transform .3s ease-in-out
}

@media(max-width: 767.98px) {
  .circle-link__icon:after,.circle-link__icon:before {
      width:4.7px;
      height: 6px;
      background-image: url();
      background-position: 50%;
      background-size: cover;
      background-repeat: no-repeat;
      background-color: hsla(0,0%,100%,0)
  }
}

.circle-link__icon:before {
  transform: translate(-260%,-50%)
}

.circle-link__icon:after {
  transform: translate(-50%,-50%)
}

.circle-link__icon--light:after,.circle-link__icon--light:before {
  background-image: url();
  background-position: 50%;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: hsla(0,0%,100%,0)
}

@media(max-width: 767.98px) {
  .circle-link__icon--light:after,.circle-link__icon--light:before {
      background-image:url();
      background-position: 50%;
      background-size: cover;
      background-repeat: no-repeat;
      background-color: hsla(0,0%,100%,0)
  }
}
</style>
